#include "OGLObjectData.h"

OGLDataObject::OGLDataObject()
{
	vboidSet = false;
}

OGLDataObject::~OGLDataObject()
{
		std::vector<OGLVAPData *>::iterator it;
		for(it = vertexAttribData.begin();
			it !=  vertexAttribData.end();
			it++)
		{
			if(*it != NULL)
				free(*it);
			*it = NULL;
		}
}

OGLResult OGLDataObject::SetVBOID(GLuint vboid)
{
	if(!vboidSet)
	{
		vboidSet = true;
		vboID = vboid;
	}
	else
	{
		fprintf(stderr, "[WARNING] VBO ID for this object is already set.\n");
		return OGL_WARNING;
	}

	return OGL_SUCCESS;
}

GLuint OGLDataObject::GetVBOID()
{
	return vboID;
}